import Vue from 'vue'
import VueRouter from "vue-router";

import Main from '../views/Main'
import Login from '../views/Login'
import Profile from "../views/user/Profile";
import List from "../views/user/List";
import fa from "element-ui/src/locale/lang/fa";

Vue.use(VueRouter);


export default new VueRouter({
  routes: [
    {
      path: '/main',
      component: Main,   // 嵌套路由
      children: [
        {
          path: '/user/profile/:id',
          name: 'Profile',
          component: Profile,
          props: true
        },
        {
          path: '/user/list',
          component: List
        }
      ]
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/goHome',
      redirect: '/main'
    }
  ]
});
